headerbar: Don't clean up other widget children
authorMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 18:25:57 +0000 (14:25 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 11 May 2020 18:25:57 +0000 (14:25 -0400)
The parent of the title_widget is the center box,
it needs to call gtk_widget_unparent on it.

gtk/gtkheaderbar.c

index 25fb6d7e75e605095d9182e115ccf1f4ea5daedf..eee669e2c83f783fd6a61d4280fed45e17769978 100644 (file)
@@ -318,7 +318,8 @@ gtk_header_bar_set_title_widget (GtkHeaderBar *bar,
   if (priv->title_widget == title_widget)
     return;
 
-  g_clear_pointer (&priv->title_widget, gtk_widget_unparent);
+  gtk_center_box_set_center_widget (GTK_CENTER_BOX (priv->center_box), NULL);
+  priv->title_widget = NULL;
 
   if (title_widget != NULL)
     {